package com.zhijian.medical.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author HCG
 * @version 1.0
 * @date 2022/1/21
 */
@AllArgsConstructor
@Getter
public enum RoleEnum {

    DIRECTOR(1, "主任"),
    DOCTOR(2, "医生，医院人员"),
    FACTORY(3, "厂家人员"),;


    private Integer code;
    private String type;

    public static RoleEnum getByCode(Integer code) {
        RoleEnum[] roleEnums = RoleEnum.values();
        for (RoleEnum roleEnum : roleEnums) {
            if (roleEnum.getCode().equals(code)) {
                return roleEnum;
            }
        }
        return null;
    }
}
